/* function len(s: string): number
function len(arr: any[]): number
function len(x: any) {
  return x.length
} */

function len(x: any[] | string) {
  return x.length
}

len('hello')
len([1, 2])
len(Math.random() > 0.5 ? 'hello': [1, 2]) // '"hello" | number[]' 联合类型

